unit EmpresaRecordFr;

{$mode objfpc}{$H+}

interface

uses
  Classes, SysUtils, FileUtil, LResources, Forms, Controls, Graphics, Dialogs,
  StdCtrls, DBCtrls, ActnList, Buttons, ExtCtrls, MainRecordFr, MainDM;

type

  { TEmpresaRecordFrame }

  TEmpresaRecordFrame = class(TMainRecordFrame)
    btBuscar: TBitBtn;
    DBEdit1: TDBEdit;
    id_empresa: TDBEdit;
    DBEdit10: TDBEdit;
    DBEdit11: TDBEdit;
    DBEdit14: TDBEdit;
    DBEdit15: TDBEdit;
    DBEdit16: TDBEdit;
    DBEdit17: TDBEdit;
    DBEdit18: TDBEdit;
    id_pessoa: TDBEdit;
    DBEdit24: TDBEdit;
    nome_pessoa: TDBEdit;
    DBEdit4: TDBEdit;
    DBEdit5: TDBEdit;
    DBEdit7: TDBEdit;
    DBEdit8: TDBEdit;
    DBEdit9: TDBEdit;
    DBMemo1: TDBMemo;
    EmpresaDBGroupBox: TDBGroupBox;
    FornecedorDBGroupBox: TDBGroupBox;
    GroupBox1: TGroupBox;
    Label1: TLabel;
    Label15: TLabel;
    Label16: TLabel;
    Label17: TLabel;
    Label18: TLabel;
    Label19: TLabel;
    Label2: TLabel;
    Label20: TLabel;
    Label21: TLabel;
    Label22: TLabel;
    Label23: TLabel;
    Label3: TLabel;
    Label4: TLabel;
    Label8: TLabel;
    Label9: TLabel;
    procedure btBuscarClick(Sender: TObject);
    procedure id_pessoaChange(Sender: TObject);

  private
    { private declarations }
  public
    { public declarations }
  end;

implementation

uses Initializator, MainFr, EmpresaDM;

{ TEmpresaRecordFrame }


procedure TEmpresaRecordFrame.btBuscarClick(Sender: TObject);
begin
  TheControl.ShowForeignFrame(TMainFrame(PessoaSearchFrame));
end;

procedure TEmpresaRecordFrame.id_pessoaChange(Sender: TObject);
begin
  if (EmpresaData.DataSetState() in [mdsEditing, mdsInserting]) then begin
    EmpresaData.EmpresaZQuery.FieldByName('id_empresa').AsString := id_pessoa.Text;
  end;
end;


initialization
  {$I empresarecordfr.lrs}

end.

